package com.bw.day15springboot02Test;

import com.bw.bean.City;
import com.bw.service.CityService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.Arrays;
import java.util.List;
import java.util.Map;


@SpringBootTest
@RunWith(SpringRunner.class)
public class day15springboot02test {
  @Autowired(required = false)
    CityService cityService;
  @Test
  public void findAll(){
    List<City> all = cityService.findAll();
    for (City city : all) {
      System.out.println(city);
    }
  }
  @Test
  public void findMo(){
    List<Map> mo = cityService.findMo("上");
    for (Map map : mo) {
      System.out.println(map);
    }
  }
  @Test
  public void findQu(){
    List<City> qu = cityService.findQu(100, 400);
    for (City city : qu) {
      System.out.println(city);
    }
  }
  @Test
  public void Sp(){
    int i = cityService.Sp(Arrays.asList(4, 5));
    if(i>0){
      System.out.println("批量删除成功");
    }else {
      System.out.println("批量删除失败");
    }
  }
}
